<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<html>
  <head>
    <title>Department</title>
	<link href="<s:url value="/css/admin.css"/>" rel="stylesheet" type="text/css">
	<s:head/>
  </head>  
 <body>
	<s:if test="%{action=='update'}">
		<s:url action="updatedepartment" id="actionurl"/>
	</s:if>
	<s:else>
		<s:url action="savedepartment" id="actionurl"/>
	</s:else>
 <s:form action="%{actionurl}" method="post">
 	<s:hidden name="action"/>
	<center><b>Department</b></center><br>
	<table width="50%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><s:actionerror/><s:fielderror/> </td>
  </tr>
</table>
	<table width="50%"  border="0" align="center" cellpadding="0" cellspacing="0"  style="border-collapse:collapse ">
  <tr>
    <td width="25%" height="25" align="right">Dept No.:</td>
    <td width="75%">
    <s:if test="%{action=='update'}">
    <s:property value="department.deptCode"/> 
    <s:hidden name="department.deptCode"/>
    </s:if>
    <s:else>
    	<s:textfield name="department.deptCode"/>
    </s:else>
    </td>
  </tr>
  <tr>
    <td height="25" align="right">Dept Name:</td>
    <td><s:textfield name="department.name"/> </td>
  </tr>
  <tr>
    <td height="25" align="right">Dept Tel:</td>
    <td><s:textfield name="department.tel"/> </td>
  </tr>
</table>
<br>
<table width="15%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr align="center">
    <td width="53%"><input type="submit" name="Submit" value=" OK "></td>
    <td width="47%"><input type="reset" name="Submit2" value=" Reset "></td>
  </tr>
</table>
</s:form>
</body>
</html>
